﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;


namespace EzyChoice
{
    [Serializable()]
    public class Alternative : EzcPerson
    {
        public Dictionary<Criteria, Dictionary<Participate, Questionnaire>> Rating = new Dictionary<Criteria, Dictionary<Participate, Questionnaire>>();
        public double Score;

        public Alternative()
        {
        }

        public override string ToString()
        {
            return Name + " (" + Score + ")";
        }

        protected Alternative(SerializationInfo info, StreamingContext context)
            : base (info, context)
        {
            this.Rating = (Dictionary<Criteria, Dictionary<Participate, Questionnaire>>)info.GetValue("Rating", typeof(Dictionary<Criteria, Dictionary<Participate, Questionnaire>>));
        }

        public override void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            base.GetObjectData(info, ctxt);
            info.AddValue("Rating", this.Rating);
        }
    }
}
